﻿using Projects;

var builder = DistributedApplication.CreateBuilder(args);

// 注册服务
var bff  = builder.AddProject<Web_Bff>("webbff"); // BFF不需要WithReference给别人
var identityService = builder.AddProject<Identity_Api>("identity-service");
var catalogService = builder.AddProject<Catalog_Api>("catalog-service");
var basketService = builder.AddProject<Basket_Api>("basket-service");
var orderService = builder.AddProject<Ordering_Api>("order-service");
var paymentService = builder.AddProject<Payment_Api>("payment-service");

bff.WithReference(identityService)
    .WithReference(catalogService)
    .WithReference(basketService)
    .WithReference(orderService);

catalogService.WithReference(basketService);

orderService.WithReference(catalogService)
    .WithReference(basketService) 
    .WithReference(paymentService);

await builder.Build().RunAsync();
